#include "mainwindow.h"
#include <QApplication>
#include <QTextCodec>
#include <QFontDatabase>


//#include "SoftKeyBoardContext.h"
int main(int argc, char *argv[])
{

    QApplication a(argc, argv);
//    int id = QFontDatabase::addApplicationFont("/opt/qt4.8.5/lib/fonts/simsun.ttc");
//    QString msyh = QFontDatabase::addApplicationFontFromData (id).at(0);
//    QFont font(msyh,10);
//    font.setPixelSize(20);
//    a.setFont(font);

    QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF8"));
    QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF8"));
    QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF8"));
//        /**3.添加要使用的字库，和字体大小，wpy-zenhei即为字库名**/
    a.setFont(QFont("simsun",8,QFont::Normal));

/*    SoftKeyBoardContext * ic = new SoftKeyBoardContext();
       a.setInputContext(ic);  */      //就这两三句就好
    MainWindow w;
    w.show();
    return a.exec();
}
